Skip to content

Fix test_bad_tz failing with python-dateutil 4 - #996

Open
itzzdev09 wants to merge 1 commit into
dask:mainfrom
itzzdev09:fix/test-bad-tz-dateutil4
Open

itzzdev09 wants to merge 1 commit into
dask:mainfrom
itzzdev09:fix/test-bad-tz-dateutil4

Conversation

@itzzdev09

Copy link
Copy Markdown

test_bad_tz fails in every "Test wheel" job (and on PRs, e.g. #994 and #995) with:

pandas/_libs/tslibs/timezones.pyx:356: AttributeError: 'NoneType' object has no attribute 'total_seconds'

The error comes from the first line of the test, pd.date_range('2012-01-01', periods=3, tz='dateutil/Europe/London'), before fastparquet is called. CI now installs python-dateutil 4.0.0, and pandas 2.3.3 can't localize a timestamp to a dateutil zone with it.

The test only needs a column with a dateutil timezone dtype, so this builds an empty DatetimeIndex with that tz instead. It has the same dtype, never localizes a value, and get_column_metadata still raises the expected ValueError.

Checked with pandas 2.3.3: the old test fails with python-dateutil 4.0.0 and the new one passes with both 4.0.0 and 2.9.0.

With python-dateutil 4.0, pandas 2.3 raises AttributeError while
localizing a timestamp to a dateutil zone, so pd.date_range fails before
get_column_metadata is reached. An empty index has the same dtype and
never localizes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant